3.5.65 \(\int \sec ^6(c+d x) (a+i a \tan (c+d x))^n \, dx\) [465]

Optimal. Leaf size=97 \[ -\frac {4 i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}+\frac {4 i (a+i a \tan (c+d x))^{4+n}}{a^4 d (4+n)}-\frac {i (a+i a \tan (c+d x))^{5+n}}{a^5 d (5+n)} \]

[Out]

-4*I*(a+I*a*tan(d*x+c))^(3+n)/a^3/d/(3+n)+4*I*(a+I*a*tan(d*x+c))^(4+n)/a^4/d/(4+n)-I*(a+I*a*tan(d*x+c))^(5+n)/
a^5/d/(5+n)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 45} \begin {gather*} -\frac {i (a+i a \tan (c+d x))^{n+5}}{a^5 d (n+5)}+\frac {4 i (a+i a \tan (c+d x))^{n+4}}{a^4 d (n+4)}-\frac {4 i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^6*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-4*I)*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n)) + ((4*I)*(a + I*a*Tan[c + d*x])^(4 + n))/(a^4*d*(4 + n
)) - (I*(a + I*a*Tan[c + d*x])^(5 + n))/(a^5*d*(5 + n))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \sec ^6(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac {i \text {Subst}\left (\int (a-x)^2 (a+x)^{2+n} \, dx,x,i a \tan (c+d x)\right )}{a^5 d}\\ &=-\frac {i \text {Subst}\left (\int \left (4 a^2 (a+x)^{2+n}-4 a (a+x)^{3+n}+(a+x)^{4+n}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^5 d}\\ &=-\frac {4 i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}+\frac {4 i (a+i a \tan (c+d x))^{4+n}}{a^4 d (4+n)}-\frac {i (a+i a \tan (c+d x))^{5+n}}{a^5 d (5+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 14.43, size = 171, normalized size = 1.76 \begin {gather*} -\frac {i 2^{5+n} e^{6 i (c+d x)} \left (e^{i d x}\right )^n \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^n \left (20+2 e^{4 i (c+d x)}+9 n+n^2+2 e^{2 i (c+d x)} (5+n)\right ) \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d \left (1+e^{2 i (c+d x)}\right )^5 (3+n) (4+n) (5+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^6*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*2^(5 + n)*E^((6*I)*(c + d*x))*(E^(I*d*x))^n*(E^(I*(c + d*x))/(1 + E^((2*I)*(c + d*x))))^n*(20 + 2*E^((4*
I)*(c + d*x)) + 9*n + n^2 + 2*E^((2*I)*(c + d*x))*(5 + n))*(a + I*a*Tan[c + d*x])^n)/(d*(1 + E^((2*I)*(c + d*x
)))^5*(3 + n)*(4 + n)*(5 + n)*Sec[c + d*x]^n*(Cos[d*x] + I*Sin[d*x])^n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.85, size = 3316, normalized size = 34.19

method result size
risch \(\text {Expression too large to display}\) \(3316\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x,method=_RETURNVERBOSE)

[Out]

-32*I/(exp(2*I*(d*x+c))+1)^5/(4+n)/(5+n)/d/(3+n)*(2/((exp(2*I*(d*x+c))+1)^n)*(exp(I*(Re(d*x)+Re(c)))^n)^2*a^n*
2^n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a/(exp(2*I*(
d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(10*I*d*
x)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn
(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^
2*csgn(I*a)*n)*exp(1/2*I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*ex
p(10*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x+c)))
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/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I/(exp(2*I*(d*x+c))+1))*n)+9*n/((e
xp(2*I*(d*x+c))+1)^n)*(exp(I*(Re(d*x)+Re(c)))^n)^2*a^n*2^n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I*Pi*csgn(I/(ex
p(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I/
(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(6*I*d*x)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I/(exp(2*I
*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(1/2
*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n)*exp(1/2*I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*
exp(2*I*(d*x+c)))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(6*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*e
xp(I*(d*x+c)))^2*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I
*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I/(exp(2*I*(...

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(n>0)', see `assume?` for more
details)Is n

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 247 vs. \(2 (85) = 170\).
time = 0.37, size = 247, normalized size = 2.55 \begin {gather*} -\frac {32 \, {\left (2 \, {\left (i \, n + 5 i\right )} e^{\left (8 i \, d x + 8 i \, c\right )} + {\left (i \, n^{2} + 9 i \, n + 20 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 2 i \, e^{\left (10 i \, d x + 10 i \, c\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{d n^{3} + 12 \, d n^{2} + 47 \, d n + {\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, {\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, {\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, {\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, {\left (d n^{3} + 12 \, d n^{2} + 47 \, d n + 60 \, d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 60 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

-32*(2*(I*n + 5*I)*e^(8*I*d*x + 8*I*c) + (I*n^2 + 9*I*n + 20*I)*e^(6*I*d*x + 6*I*c) + 2*I*e^(10*I*d*x + 10*I*c
))*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c) + 1))^n/(d*n^3 + 12*d*n^2 + 47*d*n + (d*n^3 + 12*d*n^2 + 47*d
*n + 60*d)*e^(10*I*d*x + 10*I*c) + 5*(d*n^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(8*I*d*x + 8*I*c) + 10*(d*n^3 + 12*d
*n^2 + 47*d*n + 60*d)*e^(6*I*d*x + 6*I*c) + 10*(d*n^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(4*I*d*x + 4*I*c) + 5*(d*n
^3 + 12*d*n^2 + 47*d*n + 60*d)*e^(2*I*d*x + 2*I*c) + 60*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \sec ^{6}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**6*(a+I*a*tan(d*x+c))**n,x)

[Out]

Integral((I*a*(tan(c + d*x) - I))**n*sec(c + d*x)**6, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^6*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^6, x)

________________________________________________________________________________________

Mupad [B]
time = 8.13, size = 168, normalized size = 1.73 \begin {gather*} \frac {{\mathrm {e}}^{-c\,5{}\mathrm {i}-d\,x\,5{}\mathrm {i}}\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (\frac {64\,{\mathrm {e}}^{c\,10{}\mathrm {i}+d\,x\,10{}\mathrm {i}}}{d\,\left (n^3\,1{}\mathrm {i}+n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}+60{}\mathrm {i}\right )}+\frac {{\mathrm {e}}^{c\,6{}\mathrm {i}+d\,x\,6{}\mathrm {i}}\,\left (32\,n^2+288\,n+640\right )}{d\,\left (n^3\,1{}\mathrm {i}+n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}+60{}\mathrm {i}\right )}+\frac {{\mathrm {e}}^{c\,8{}\mathrm {i}+d\,x\,8{}\mathrm {i}}\,\left (64\,n+320\right )}{d\,\left (n^3\,1{}\mathrm {i}+n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}+60{}\mathrm {i}\right )}\right )}{32\,{\cos \left (c+d\,x\right )}^5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)*1i)^n/cos(c + d*x)^6,x)

[Out]

(exp(- c*5i - d*x*5i)*(a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n*((64*exp(c*10i + d*x*10i))/(d*(n*47i + n^2*12i
+ n^3*1i + 60i)) + (exp(c*6i + d*x*6i)*(288*n + 32*n^2 + 640))/(d*(n*47i + n^2*12i + n^3*1i + 60i)) + (exp(c*8
i + d*x*8i)*(64*n + 320))/(d*(n*47i + n^2*12i + n^3*1i + 60i))))/(32*cos(c + d*x)^5)

________________________________________________________________________________________